Skip to content

fix: confine single-origin benches to their pinned region in overlayEditorial - #2276

Merged
Flotapponnier merged 1 commit into
mainfrom
hotfix/confine-pinned-region
Sep 8, 2026
Merged

fix: confine single-origin benches to their pinned region in overlayEditorial#2276
Flotapponnier merged 1 commit into
mainfrom
hotfix/confine-pinned-region

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Follow-up to #2274, which did not close the leak.

Why #2274 missed it: the guard was applied to the benchmark variable in page.tsx, but variants is seeded from the unfiltered aggregate a few lines earlier and passed to <BenchmarkBody>. RSC deduplication made it visible: the us-east arrays were inline and the sgp arrays were $refs back to the already-serialized (stripped) benchmark prop.

This change: confineToPinnedRegion(b, spec) in src/lib/spec.ts, called at the end of overlayEditorial, where this build's spec is already overlaid on the stored snapshot. When the spec declares no region dimension and pins one via aggregate_filters.region, extras.regions, seriesByRegion{24h,7d,30d} and cellRanks are reduced to that region. Benches that declare region tabs, or pin nothing, are returned untouched. page.tsx goes back to const benchmark = aggregate;.

Replayed on the live blob with main's spec: regions ["sgp"], per-region series ["sgp"], cellRanks ["all|sgp"], 3 results. With dev's spec (tabs declared): both regions kept.

tsc and eslint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CpArutAtXuBb1BVNUDXoYA

…layEditorial

The previous guard lived in page.tsx and only reached the `benchmark`
prop; `variants` was seeded from the unfiltered aggregate a few lines
earlier and shipped every region the worker computed into the RSC
payload (us-east series and ranks for keyed-rpc-robinhood, on a page
that only shows Singapore).

Moving the confinement into overlayEditorial, where this build's spec is
already overlaid on the stored snapshot, scopes the object at the source:
aggregate, variants, filtered variants and list views all inherit it.
Benches that declare region tabs, or pin nothing, are untouched. Also
covers the 7d and 30d per-region series the page guard missed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CpArutAtXuBb1BVNUDXoYA
@Flotapponnier
Flotapponnier merged commit fe6a0a0 into main Sep 8, 2026
@Flotapponnier
Flotapponnier deleted the hotfix/confine-pinned-region branch September 8, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant